//
//  KSGetOrderDetailModel.swift
//  Supermarket
//
//  Created by Black_Crystal on 2017/9/26.
//  Copyright © 2017年 kushao. All rights reserved.
//

import UIKit
import HandyJSON

// 供货管理-订单详情
class KSGetOrderDetailModel: KSBaseModel {
    var data: KSGetOrderDetailDataModel?
    required init() {}
}

class KSGetOrderDetailDataModel: HandyJSON {
    var id: Int?                                                                // 订单id
    var order_number: String?                                                   // 订单号（内购单id）
    var order_state: Int = 0                                                    // 订单状态
    var add_time: String?                                                       // 下单时间
    var buyer_id: Int?                                                          // 买家id
    var order_amount: Int = 0                                                   // 订单总价
    var shipping_fee: Int = 0                                                   // 运费
    var storage_id: Int?                                                        // 仓库id
    var storage_name: String?                                                   // 仓库名字
    var name: String?                                                           // 买家名字
    var mobile: String?                                                         // 买家手机号
    var user_area_info: String?                                                 // 买家详细地址
    var goods_sum_num: String?                                                  // 数量
    var mark: String = ""                                                       // 留言
    var operate_name: String = ""                                               // 操作员
    var delivery_box_goods_lis: [KSGetOrderListDeliverBoxGoodsListModel]?       // 订单商品列表
    var order_goods: [KSGetOrderListOrderGoodsModel]?                           // 配送箱商品列表（order_state值为6时有该字段）
    required init() {}
}

class KSGetOrderListDeliverBoxGoodsListModel: HandyJSON {
    var barcode: String?                                                        // 配送箱编号
    var goods_list: KSGetOrderListDeliverBoxGoodsListDetaialModel?              // 商品列表
    required init() {}
}

class KSGetOrderListOrderGoodsModel: HandyJSON {
    var id: Int?                                                                // id
    var order_id: Int?
    var storage_id: Int?
    var goods_id: Int?
    var total_price: String = ""                                                // 商品总价
    var goods_name: String?                                                     // 商品名称
    var selling_price: Int = 0                                                  // 单价
    var goods_num: String = "0"                                                 // 数量
    var good_sku_relation_id: Int?                                              // 销售属性id
    var type: Int?                                                              // 商品类型 1条码商品 2无条码商品 3称重商品
    var bar_code: String?                                                       // 条形码
    var unit: String?                                                           // 单位
    var is_allow_refund: String?                                                // 是否可退 0 不可退 1 可退
    var sku_detail: [KSGetOrderListDeliverBoxGoodsListSkuDetailsModel]?         // 商品规格：格式为 [ [‘name’:’val’], [‘name’:’val’] ]
    required init() {}
}

class KSGetOrderListDeliverBoxGoodsListDetaialModel: HandyJSON {
    var goods_name: String?                                                     // 商品名称
    var price: Int?                                                             // 单价
    var dividing_num: Int?                                                      // 购买数量
    var bar_code: Int?                                                          // 条形码
    var unit: String?
    var sku_details: KSGetOrderListDeliverBoxGoodsListSkuDetailsModel?          // 商品规格：格式为 [ [‘name’:’val’], [‘name’:’val’] ]
    required init() {}
}

class KSGetOrderListDeliverBoxGoodsListSkuDetailsModel: HandyJSON {
    var name = ""
    var value = ""
    required init() {}
}
